﻿namespace Example
{
    using Xunit;

    public sealed class CheckAmountFacts
    {
        [Fact]
        public void ctor()
        {
            Assert.NotNull(new CheckAmount(0.01m));
        }

        [Fact]
        public void op_ToString()
        {
            const string expected = "Zero and 01/100 dollars";
            var actual = new CheckAmount(0.01m).ToString();

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void op_ToString_when1dollar4cents()
        {
            const string expected = "One and 04/100 dollars";
            var actual = new CheckAmount(1.04m).ToString();

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void op_ToString_when1hundred9dollars4cents()
        {
            const string expected = "One hundred nine and 04/100 dollars";
            var actual = new CheckAmount(109.04m).ToString();

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void op_ToString_when2thousand1hundred9dollars4cents()
        {
            const string expected = "Two thousand five hundred twenty-three and 04/100 dollars";
            var actual = new CheckAmount(2523.04m).ToString();

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void op_ToString_when40cents()
        {
            const string expected = "Zero and 40/100 dollars";
            var actual = new CheckAmount(0.40m).ToString();

            Assert.Equal(expected, actual);
        }
    }
}